Ext.define('NF.view.farm.FarmLivestockList', {
    extend:'Ext.grid.Panel',
    alias:'widget.farmLivestockList',
    frame:true,
    store:'FarmLivestockList',
    autoScroll:true,
    dockedItems:[
        {
            xtype: 'pagingtoolbar',
            store:'FarmLivestockList',   // same store GridPanel is using
            dock: 'top',
            displayInfo: true
        }
    ],
    initComponent:function() {
        var self = this;
        this.columns = [
             Ext.create('Ext.grid.RowNumberer'),
            {header:'Livestock ID',dataIndex:'id',flex:1},
            {header:'Livestock name',dataIndex:'name',flex:1}
        ];
        this.callParent(arguments);
        this.loadLivestockList(self.model.context);
        this.setTitle(self.model.context.name + " Livestock");
    },
    loadLivestockList:function(paramData) {
        var self = this;
        var livestockStore = this.getStore();
        livestockStore.getProxy().extraParams.id = paramData.id;
        livestockStore.load();
    }
});